import { fromJS } from 'immutable'
import searchMethod from '../methods/searchMethod'

const defaultState = fromJS({
  searchs: [],
  searchStatus: false
})

export default (state = defaultState, action) => {
  try {
    return searchMethod[action.type](state, action)
  } catch (e) {
    return state
  }
}